package com.wwy.arithmetic.newsuanfa;

import java.util.Deque;
import java.util.LinkedList;

/**
 * @author 王伟羽
 * @program: arithmetictest
 * @description:
 * @create: 2025/04/01
 */

public class Pipeixiabiao {

    public int strStr(String haystack, String needle) {
        if (haystack.equals(needle)) {
            return 0;
        }
        String[] split = haystack.split(needle);
        if (haystack.contains(needle)) {
            if (split.length == 0) {
                return 0;
            }
            return split[0].length();
        }
        return -1;
    }
}
